/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.modelo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author gilberto.costa
 */
@Entity
@Table(name = "ecf_tipo_pagamento")
public class TipoPagamento implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Integer id;
    @Size(max = 3)
    @Column(name = "CODIGO")
    private String codigo;
    @Size(max = 20)
    @Column(name = "DESCRICAO")
    private String descricao;
    @Column(name = "TEF")
    private Character tef;
    @Column(name = "IMPRIME_VINCULADO")
    private Character imprimeVinculado;
    @Column(name = "PERMITE_TROCO")
    private Character permiteTroco;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idEcfTipoPagamento")
    private List<TotalTipoPgto> totalTipoPgtoList = new ArrayList<TotalTipoPgto>();

    public TipoPagamento() {
    }

    public TipoPagamento(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public Character getTef() {
        return tef;
    }

    public void setTef(Character tef) {
        this.tef = tef;
    }

    public Character getImprimeVinculado() {
        return imprimeVinculado;
    }

    public void setImprimeVinculado(Character imprimeVinculado) {
        this.imprimeVinculado = imprimeVinculado;
    }

    public Character getPermiteTroco() {
        return permiteTroco;
    }

    public void setPermiteTroco(Character permiteTroco) {
        this.permiteTroco = permiteTroco;
    }

    public List<TotalTipoPgto> getTotalTipoPgtoList() {
        return totalTipoPgtoList;
    }

    public void setTotalTipoPgtoList(List<TotalTipoPgto> totalTipoPgtoList) {
        this.totalTipoPgtoList = totalTipoPgtoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoPagamento)) {
            return false;
        }
        TipoPagamento other = (TipoPagamento) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.modelo.TipoPagamento[ id=" + id + " ]";
    }
    
}
